Why Don't My Links Work?

One of the most common questions I receive in email regards problems getting hypertext links to operate or images to show up while prototyping documents. And almost without fail there are two reasons:

1) Remember that links are processed by an HTTP server, not your browser. Some browsers are "smart" enough to locate documents by relative reference if they are in the same folder as the current document, but this is only a nice feature of some browsers, not the way the Web operates. In order to test your links, view images, test CGI/forms/clickable imagemaps, etc. you must load the documents on an HTTP server. The next Help section "Setting Up a Web Server" describes this in some detail, with the following section ("Prototyping Your Pages Using the Hosts File") providing information on setting up a prototype server. Please note that I do not provide support for server development. Links to the MacHTTP and WebStar home pages are provided under the Hotlist menu. Both applications include very well-written documentation on configuring a server.

2) Links only work when the anchor element's HREF (or the IMG element's SRC) attribute contains a valid URL. All parts of the URL must operate correctly: the URL must have the correct form and have no spelling errors; the server name (when used) must be recognized and look up properly; the directory path and file name must be correct; and the file must have a ".html" suffix. Without the ".html" suffix, servers and browsers will assume the file is a plain text file and process it accordingly. If you intend the file to be browsed as a text file, you should suffix it with ".txt" or ".text".

Back to Document Terminology, on to Setting Up a Web Server, or return to Design Issues.